﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication1.Controllers
{
    public class Default1Controller : Controller
    {

        public ActionResult Get_View()
        {
            MvcApplication1.Models.Employee emp = new Models.Employee();
            emp.FirstName = "adfs";
            emp.LastName = "dadsa";
            emp.Salary = 15000;

            MvcApplication1.ViewModels.EmployeeViewModel empVM = new ViewModels.EmployeeViewModel();
            empVM.EmployeeName = emp.FirstName + emp.LastName;
            empVM.Salary = emp.Salary.ToString();
            if (emp.Salary >= 10000)
            {
                empVM.SalaryColor = "yellow";
            }
            else
            {
                empVM.SalaryColor = "blue";
            }



            return View("indexPage", empVM);
        }


        //不允许使用web调用
        [NonAction]
        public string Index()
        {
            return "hello mvc4";
        }

    }
}
